#pragma  once
//#include <wdm.h>
#include "public.h"
#include <string.h>

extern "C"{
#include <ntddk.h>
};

typedef struct _USBFILTER_DEVICE_EXTENSION
{
	PDEVICE_OBJECT AttachedToDeviceObject;
	IO_REMOVE_LOCK RemoveLock;
	BOOLEAN isWathDevice;
} USBFILTER_DEVICE_EXTENSION, *PUSBFILTER_DEVICE_EXTENSION;


#define arraysize(p) (sizeof(p)/sizeof((p)[0]))

extern "C" NTSTATUS	DriverEntry(IN PDRIVER_OBJECT,IN  PUNICODE_STRING pRegistryPath);
NTSTATUS	US_AddDevice(IN PDRIVER_OBJECT, IN PDEVICE_OBJECT);
VOID		US_Unload(PDRIVER_OBJECT);

BOOLEAN		US_PassPacketToUserMode(PIRP, BOOLEAN);

NTSTATUS	US_ControlRoutine(IN PDEVICE_OBJECT, IN PIRP);
NTSTATUS	US_CompletionRoutine(IN PDEVICE_OBJECT fido, IN PIRP pIrp, IN PVOID context);

NTSTATUS	US_DispatchPnp(IN PDEVICE_OBJECT, IN PIRP);
NTSTATUS	US_DispatchPower(IN PDEVICE_OBJECT,IN PIRP);
NTSTATUS	US_DispatchAny(IN PDEVICE_OBJECT, IN PIRP);
NTSTATUS	US_DispatchCreate(IN PDEVICE_OBJECT, IN PIRP);
NTSTATUS	US_DispatchClose(IN PDEVICE_OBJECT, IN PIRP);
NTSTATUS	US_DispatchIOCTL(IN PDEVICE_OBJECT, IN PIRP);

VOID		US_RemoveDevice(IN PDEVICE_OBJECT);
BOOLEAN		US_IsStringTerminated(PCHAR, unsigned int);
NTSTATUS	US_CompleteRequest(IN PIRP, IN NTSTATUS, IN ULONG_PTR);
NTSTATUS	US_StartDeviceCompletionRoutine(PDEVICE_OBJECT, PIRP, PUSBFILTER_DEVICE_EXTENSION);
NTSTATUS	US_UsageNotificationCompletionRoutine(PDEVICE_OBJECT, PIRP, PUSBFILTER_DEVICE_EXTENSION);
